Optimal. Leaf size=124 \[ -\frac {\left (a^2-2 b^2\right ) \cos (c+d x)}{d}+\frac {2 a b \cos ^2(c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \cos ^3(c+d x)}{3 d}-\frac {a b \cos ^4(c+d x)}{2 d}-\frac {a^2 \cos ^5(c+d x)}{5 d}-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \sec (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 124, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3957, 2916, 12,
962} \begin {gather*} \frac {\left (2 a^2-b^2\right ) \cos ^3(c+d x)}{3 d}-\frac {\left (a^2-2 b^2\right ) \cos (c+d x)}{d}-\frac {a^2 \cos ^5(c+d x)}{5 d}-\frac {a b \cos ^4(c+d x)}{2 d}+\frac {2 a b \cos ^2(c+d x)}{d}-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \sec (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 962
Rule 2916
Rule 3957
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^2 \sin ^5(c+d x) \, dx &=\int (-b-a \cos (c+d x))^2 \sin ^3(c+d x) \tan ^2(c+d x) \, dx\\ &=\frac {\text {Subst}\left (\int \frac {a^2 (-b+x)^2 \left (a^2-x^2\right )^2}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a^5 d}\\ &=\frac {\text {Subst}\left (\int \frac {(-b+x)^2 \left (a^2-x^2\right )^2}{x^2} \, dx,x,-a \cos (c+d x)\right )}{a^3 d}\\ &=\frac {\text {Subst}\left (\int \left (a^4 \left (1-\frac {2 b^2}{a^2}\right )+\frac {a^4 b^2}{x^2}-\frac {2 a^4 b}{x}+4 a^2 b x-\left (2 a^2-b^2\right ) x^2-2 b x^3+x^4\right ) \, dx,x,-a \cos (c+d x)\right )}{a^3 d}\\ &=-\frac {\left (a^2-2 b^2\right ) \cos (c+d x)}{d}+\frac {2 a b \cos ^2(c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \cos ^3(c+d x)}{3 d}-\frac {a b \cos ^4(c+d x)}{2 d}-\frac {a^2 \cos ^5(c+d x)}{5 d}-\frac {2 a b \log (\cos (c+d x))}{d}+\frac {b^2 \sec (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.24, size = 112, normalized size = 0.90 \begin {gather*} -\frac {30 \left (5 a^2-14 b^2\right ) \cos (c+d x)-180 a b \cos (2 (c+d x))-25 a^2 \cos (3 (c+d x))+20 b^2 \cos (3 (c+d x))+15 a b \cos (4 (c+d x))+3 a^2 \cos (5 (c+d x))+480 a b \log (\cos (c+d x))-240 b^2 \sec (c+d x)}{240 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 120, normalized size = 0.97
method | result | size |
derivativedivides | \(\frac {b^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+2 b a \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-\frac {a^{2} \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}}{d}\) | \(120\) |
default | \(\frac {b^{2} \left (\frac {\sin ^{6}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )\right )+2 b a \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-\frac {a^{2} \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}}{d}\) | \(120\) |
norman | \(\frac {\frac {16 a^{2}-80 b^{2}}{15 d}-\frac {32 \left (a^{2}+b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 b a \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {16 b a \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 \left (16 a^{2}+15 b a -80 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}+\frac {\left (16 a^{2}+48 b a -80 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}-\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}-\frac {2 b a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}+\frac {2 b a \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(230\) |
risch | \(2 i a b x +\frac {3 b a \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {5 a^{2} {\mathrm e}^{i \left (d x +c \right )}}{16 d}+\frac {7 \,{\mathrm e}^{i \left (d x +c \right )} b^{2}}{8 d}-\frac {5 a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{16 d}+\frac {7 \,{\mathrm e}^{-i \left (d x +c \right )} b^{2}}{8 d}+\frac {3 b a \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {4 i b a c}{d}+\frac {2 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}-\frac {2 b a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}-\frac {a^{2} \cos \left (5 d x +5 c \right )}{80 d}-\frac {b a \cos \left (4 d x +4 c \right )}{16 d}+\frac {5 a^{2} \cos \left (3 d x +3 c \right )}{48 d}-\frac {\cos \left (3 d x +3 c \right ) b^{2}}{12 d}\) | \(233\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.26, size = 105, normalized size = 0.85 \begin {gather*} -\frac {6 \, a^{2} \cos \left (d x + c\right )^{5} + 15 \, a b \cos \left (d x + c\right )^{4} - 60 \, a b \cos \left (d x + c\right )^{2} - 10 \, {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{3} + 60 \, a b \log \left (\cos \left (d x + c\right )\right ) + 30 \, {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right ) - \frac {30 \, b^{2}}{\cos \left (d x + c\right )}}{30 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.05, size = 125, normalized size = 1.01 \begin {gather*} -\frac {48 \, a^{2} \cos \left (d x + c\right )^{6} + 120 \, a b \cos \left (d x + c\right )^{5} - 480 \, a b \cos \left (d x + c\right )^{3} - 80 \, {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 480 \, a b \cos \left (d x + c\right ) \log \left (-\cos \left (d x + c\right )\right ) + 195 \, a b \cos \left (d x + c\right ) + 240 \, {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 240 \, b^{2}}{240 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sec {\left (c + d x \right )}\right )^{2} \sin ^{5}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 418 vs.
\(2 (118) = 236\).
time = 0.51, size = 418, normalized size = 3.37 \begin {gather*} \frac {60 \, a b \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right ) - 60 \, a b \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right ) + \frac {60 \, {\left (a b + b^{2} + \frac {a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1} + \frac {32 \, a^{2} + 137 \, a b - 100 \, b^{2} - \frac {160 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {805 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {440 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {320 \, a^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {1970 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {640 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {1970 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {360 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {805 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {60 \, b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {137 \, a b {\left (\cos \left (d x + c\right ) - 1\right )}^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{{\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1\right )}^{5}}}{30 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.95, size = 104, normalized size = 0.84 \begin {gather*} -\frac {\cos \left (c+d\,x\right )\,\left (a^2-2\,b^2\right )-{\cos \left (c+d\,x\right )}^3\,\left (\frac {2\,a^2}{3}-\frac {b^2}{3}\right )+\frac {a^2\,{\cos \left (c+d\,x\right )}^5}{5}-\frac {b^2}{\cos \left (c+d\,x\right )}-2\,a\,b\,{\cos \left (c+d\,x\right )}^2+\frac {a\,b\,{\cos \left (c+d\,x\right )}^4}{2}+2\,a\,b\,\ln \left (\cos \left (c+d\,x\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________